<template>
	<div class="" style="width: 100%;">
		<head-top></head-top>


	
		<div class="table_container" :style="'width: 90%;  overflow: hidden;  height:'+winHeight/2.3+'px;'">
			<div style="margin: 5px; display: flex;">
				<span style="font-size: 20px;">CONFIG 配置表: </span>
				<div>
					<el-button size="mini" type="success" @click="refleash_config()">刷新</el-button>
					<el-button size="mini" type="primary" @click="addnew_config()">新增</el-button>
				</div>

				<span style="font-size: medium; padding: 10px;">账号:</span>
				<el-select v-model="account_choice" size="small" clearable filterable placeholder="请选择"
					@change="changeaccount_choice()">
					<el-option v-for="item in account_options" :key="item.label" :label="item.label"
						:value="item.value">
					</el-option>
				</el-select>

				<span style="font-size: medium; padding: 10px;">日期:</span>
				<el-select v-model="date_choice" size="small" clearable filterable placeholder="请选择"
					@change="changedate_choice()">
					<el-option v-for="item in date_options" :key="item.label" :label="item.label" :value="item.value">
					</el-option>
				</el-select>

			</div>

			<el-table ref="singleTable" :data="config_data" height="95%" border size='small' :fit='true'
				:style="'width:'+(screenWidth*1.0)+'px;'" :row-class-name="tableRowClassNameconfig">
				<!-- 	<el-table-column label="index" type="index" width="60" align="center"></el-table-column> -->
				<el-table-column prop="configindex" label="编号" width="60" align></el-table-column>
				
	
				<el-table-column prop="server" label="server" width="120" sortable align>
					<template slot-scope="scope">
						<el-select v-model="scope.row['server']" size="small" clearable allow-create filterable
							:disabled="scope.row['config_status'].indexOf('完成') != -1" collapse-tags style="" placeholder="请选择"
							@change="change_cell($event,scope,'config')">
							<el-option v-for="item in server_list" :key="item.value" :label="item.label"
								:value="item.value">
							</el-option>
						</el-select>
					</template>
				</el-table-column>
				
				
				<el-table-column prop="account" label="账户" width="160" sortable align>
					<template slot-scope="scope">
						<el-select v-model="scope.row['account']" size="small" clearable
							:disabled="scope.row['config_status'].indexOf('完成') != -1" style="" placeholder="请选择"
							@change="change_cell($event,scope,'config')">
							<el-option v-for="item in account_options" :key="item.value" :label="item.label"
								:value="item.value">
							</el-option>
						</el-select>
					</template>
				</el-table-column>


				
				
				<el-table-column prop="kkdate" label="截至日期" width="120" sortable align>
					<template slot-scope="scope">
						<el-input v-model="scope.row['kkdate']" :disabled="scope.row['config_status'].indexOf('完成') != -1"
							size="small" placeholder="" @change="change_cell($event,scope,'config')"></el-input>
					</template>
				</el-table-column>
			
			
				<el-table-column prop="time" label="时间" width="120" sortable align>
					<template slot-scope="scope">
						<el-select v-model="scope.row['time']" size="small" clearable
							:disabled="scope.row['config_status'].indexOf('完成') != -1" collapse-tags style="" placeholder="请选择"
							@change="change_cell($event,scope,'config')">
							<el-option v-for="item in time_list" :key="item.value" :label="item.label"
								:value="item.value">
							</el-option>
						</el-select>
					</template>
				</el-table-column>
			
			
						
			
		
				<el-table-column prop="config_Path" label="config_Path" align>
					<template slot-scope="scope">
						<el-input v-model="scope.row['config_Path']" :disabled="scope.row['config_status'].indexOf('完成') != -1"
							size="small" placeholder="" @change="change_cell($event,scope,'config')"></el-input>
					</template>
				</el-table-column>

				<el-table-column prop="config_worker" label="执行人" width="120" sortable align>
					<template slot-scope="scope">
						<el-select v-model="scope.row['config_worker']" size="small"
							:disabled="scope.row['config_status'].indexOf('完成') != -1" collapse-tags style="" placeholder="请选择"
							@change="change_cell($event,scope,'config')">
							<el-option v-for="item in worker_list" :key="item.value" :label="item.label"
								:value="item.value">
							</el-option>
						</el-select>
					</template>
				</el-table-column>


				
				<el-table-column prop="config_status" label="状态" width="120" align>
					<template slot-scope="scope">
						<!-- :disabled="scope.row['status']=='完成' " -->
						<el-select v-model="scope.row['config_status']" size="small" collapse-tags style="" placeholder="请选择"
							@change="change_cell($event,scope,'config')">
							<el-option v-for="item in status_options" :key="item.value" :label="item.label"
								:value="item.value">
							</el-option>
						</el-select>
					</template>
				</el-table-column>
				
				
				
				<el-table-column prop="future_operate" label="future_operate" align>
					<template slot-scope="scope">
						<el-input v-model="scope.row['future_operate']" :disabled="scope.row['future_status'].indexOf('完成') != -1"
							size="small" placeholder="" @change="change_cell($event,scope,'config')"></el-input>
					</template>
				</el-table-column>
				
				
				<el-table-column prop="future_worker" label="执行人" width="120" sortable align>
					<template slot-scope="scope">
						<el-select v-model="scope.row['future_worker']" size="small"
							:disabled="scope.row['future_status'].indexOf('完成') != -1" collapse-tags style="" placeholder="请选择"
							@change="change_cell($event,scope,'config')">
							<el-option v-for="item in worker_list" :key="item.value" :label="item.label"
								:value="item.value">
							</el-option>
						</el-select>
					</template>
				</el-table-column>
				<el-table-column prop="future_status" label="状态" width="120" align>
					<template slot-scope="scope">
						<!-- :disabled="scope.row['status']=='完成' " -->
						<el-select v-model="scope.row['future_status']" size="small" collapse-tags style="" placeholder="请选择"
							@change="change_cell($event,scope,'config')">
							<el-option v-for="item in status_options" :key="item.value" :label="item.label"
								:value="item.value">
							</el-option>
						</el-select>
					</template>
				</el-table-column>
				
				<!-- <el-table-column prop="kkupdatetime" label="更新时间" width="140" align></el-table-column> -->
				<el-table-column label="操作" :width='90'>
					<template slot-scope="scope">
						<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row,'config')">删除
						</el-button>
						<!-- <el-button size="small" type="warning" @click="change_configindex(scope.$index, scope.row)">详情</el-button> -->
					</template>
				</el-table-column>
			</el-table>

		</div>
	<div class="table_container" :style="'width: 90%;  overflow: hidden;  height:'+winHeight/2.3+'px;'">
		<div style="margin: 5px; display: flex;">
			<span style="font-size: 20px;">BINARY 配置表:</span>
			<div>
				<el-button size="mini" type="success" @click="refleash_binary()">刷新</el-button>
				<el-button size="mini" type="primary" @click="addnew_binary()">新增</el-button>
			</div>
	
		</div>
	
		<el-table ref="singleTable" :data="binary_data" height="95%" border size='small' :fit='true'
			:style="'width:'+(screenWidth*1.0)+'px;'" :row-class-name="tableRowClassNamebinary">
			<!-- 	<el-table-column label="index" type="index" width="60" align="center"></el-table-column> -->
			<el-table-column prop="binary_index" label="编号" width="60" align></el-table-column>
			

			<el-table-column prop="server" label="server" width="120" sortable align>
				<template slot-scope="scope">
					<el-select v-model="scope.row['server']" size="small" clearable allow-create filterable
						:disabled="scope.row['status'].indexOf('完成') != -1" collapse-tags style="" placeholder="请选择"
						@change="change_cell($event,scope,'binary')">
						<el-option v-for="item in server_list" :key="item.value" :label="item.label"
							:value="item.value">
						</el-option>
					</el-select>
				</template>
			</el-table-column>
			
			
		
			
			
			<el-table-column prop="kkdate" label="日期" width="120" sortable align>
				<template slot-scope="scope">
					<el-input v-model="scope.row['kkdate']" :disabled="scope.row['status'].indexOf('完成') != -1"
						size="small" placeholder="" @change="change_cell($event,scope,'binary')"></el-input>
				</template>
			</el-table-column>
		
		<!-- 
			<el-table-column prop="time" label="时间" width="120" sortable align>
				<template slot-scope="scope">
					<el-select v-model="scope.row['time']" size="small" clearable
						:disabled="scope.row['status'].indexOf('完成') != -1" collapse-tags style="" placeholder="请选择"
						@change="change_cell($event,scope,'binary')">
						<el-option v-for="item in time_list" :key="item.value" :label="item.label"
							:value="item.value">
						</el-option>
					</el-select>
				</template>
			</el-table-column> -->
			
			<el-table-column prop="using_binary" label="using_binary"  width="150" align>
					<template slot-scope="scope">
						<el-input v-model="scope.row['using_binary']" :disabled="scope.row['status'].indexOf('完成') != -1"
							size="small" placeholder="" @change="change_cell($event,scope,'binary')"></el-input>
					</template>
				</el-table-column>
					
			
			<el-table-column prop="updateplan" label="updateplan" width="150" align>
				<template slot-scope="scope">
					<el-input v-model="scope.row['updateplan']" :disabled="scope.row['status'].indexOf('完成') != -1"
						size="small" placeholder="" @change="change_cell($event,scope,'binary')"></el-input>
				</template>
			</el-table-column>
			<el-table-column prop="Path" label="Path" align>
				<template slot-scope="scope">
					<el-input v-model="scope.row['Path']" :disabled="scope.row['status'].indexOf('完成') != -1"
						size="small" placeholder="" @change="change_cell($event,scope,'binary')"></el-input>
				</template>
			</el-table-column>
			
		
			
			
			<el-table-column prop="prod" label="prod"  width="200" align>
				<template slot-scope="scope">
					<el-input v-model="scope.row['prod']" :disabled="scope.row['status'].indexOf('完成') != -1"
						size="small" placeholder="" @change="change_cell($event,scope,'binary')"></el-input>
				</template>
			</el-table-column>
			
			<el-table-column prop="updater" label="updater" width="120" sortable align>
				<template slot-scope="scope">
					<el-select v-model="scope.row['updater']" size="small"
						:disabled="scope.row['status'].indexOf('完成') != -1" collapse-tags style="" placeholder="请选择"
						@change="change_cell($event,scope,'binary')">
						<el-option v-for="item in worker_list" :key="item.value" :label="item.label"
							:value="item.value">
						</el-option>
					</el-select>
				</template>
			</el-table-column>
				
			<el-table-column prop="orthorizer" label="执行人" width="120" sortable align>
				<template slot-scope="scope">
					<el-select v-model="scope.row['orthorizer']" size="small"
						:disabled="scope.row['status'].indexOf('完成') != -1" collapse-tags style="" placeholder="请选择"
						@change="change_cell($event,scope,'binary')">
						<el-option v-for="item in worker_list" :key="item.value" :label="item.label"
							:value="item.value">
						</el-option>
					</el-select>
				</template>
			</el-table-column>
			
	
		
			<el-table-column prop="status" label="状态" width="120" align>
				<template slot-scope="scope">
					<!-- :disabled="scope.row['status']=='完成' " -->
					<el-select v-model="scope.row['status']" size="small" collapse-tags style="" placeholder="请选择"
						@change="change_cell($event,scope,'binary')">
						<el-option v-for="item in status_options" :key="item.value" :label="item.label"
							:value="item.value">
						</el-option>
					</el-select>
				</template>
			</el-table-column>
				<!-- <el-table-column prop="kkupdatetime" label="更新时间" width="140" align></el-table-column> -->
			<el-table-column label="操作" :width='90'>
				<template slot-scope="scope">
					<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row,'binary')">删除
					</el-button>
					<!-- <el-button size="small" type="warning" @click="change_configindex(scope.$index, scope.row)">详情</el-button> -->
				</template>
			</el-table-column>
		</el-table>
	
	</div>
	
	</div>
</template>

<script>
	import headTop from '@/components/headTop'
	export default {
		data() {
			return {
				checkflag: false,
				core_pos: [],
				pos_index_item: '',
				account_choice: "",
				account_options: [],
				target_pos_index_options: [],
				date_choice: "",
				date_options: [],
				tableData: [],
				currentRow: null,
				
				count: 0,
				exchange_detail: [],
				kkdata: [],
			
				fix_account: {},
				visible: false,
				visible2: false,
			

				screenWidth: document.body.clientWidth, // 屏幕尺寸
				screenHeight: document.body.clientHeight, // 屏幕尺寸
				configindex: "0",
				binaryindex: "0",
				config_data: [],
				binary_data:[],
				
				
				time_list:[
				{
					value: '9:25',
					label: '9:25'
				},
				{
					value: '11:25',
					label: '11:25'
				},
				{
					value: '2:30',
					label: '2:30'
				},
				
				{
					value: '18:30',
					label: '18:30'
				},
				
				
				],	
				worker_list:[
					{
						value: '游雄凯',
						label: '游雄凯'
					},
					{
						value: '胡睦',
						label: '胡睦'
					},
					{
						value: '郭健',
						label: '郭健'
					},
					{
						value: '张边远',
						label: '张边远'
					},
					{
						value: '安姣姣',
						label: '安姣姣'
					},
					
				],
				status_options: [{
						value: '待处理',
						label: '待处理'
					},

					{
						value: '异常',
						label: '异常'
					},
					{
						value: '完成',
						label: '完成'
					},

				],
				type_options: [{
						value: 'config_update',
						label: 'config_update'
					},{
						value: 'binary_update',
						label: 'binary_update'
					},

					

				],

			}
		},
		components: {
			headTop,
		},



		activated() {

			// console.log("当前登入用户", this.$store.state.adminInfo.name);
			//    if (this.tradesysPermission_list.indexOf (this.$store.state.adminInfo.permission) ==-1) {
			// 	console.log(this.$store.state.adminInfo.name,"未登入")
			// 	this.$message({type: 'error',	message: '没有权限',});
			// 	this.$router.push({
			// 		path: `/manage`
			// 	})
			// }
		},
		created() {
			this.get_tradesys_account()
			this.get_config_data()
			this.get_binary_data()
			this.get_date_last()
		},
		computed: {
			//showTable计算属性通过slice方法计算表格当前应显示的数据

		},

		methods: {
			changedate_choice() {

				this.get_config_data()
			},

			changeaccount_choice() {
				this.get_config_data()
			},
			
			
			
			
			
			
			
			
			
			
			
			
			
			change_cell($event, scope,type) {
				// console.log(scope.$index)
				var that = this
				console.log(scope,type)
			
				// this.$message({
				// 	message: '已经修改',
				// 	type: 'warning'
				// });
				var data_item 
				let sql2=''
				if (type=='config'){
					data_item = this.config_data[scope.$index]
					sql2 = "UPDATE `LP_tradesys_config` SET \
						`account` = '" + data_item['account'] + "', `last_date` = '" + data_item['kkdate'] + "', \
						`config_Path` = '" + data_item['config_Path'] + "', `config_status` = '" + data_item['config_status'] + "',   \
						`config_worker` = '" + data_item['config_worker'] + "', `future_operate` = '" + data_item['future_operate'] + "',   \
						`time` = '" + data_item['time'] + "', `future_status` = '" + data_item['future_status'] + "', \
						`future_worker` = '" + data_item['future_worker'] + "', \
						`server` = '" + data_item['server'] + "' \
						WHERE `configindex` = " + data_item['configindex'] + ";"
						
						
						let msg= `编号:${data_item['configindex']} 修改CONFIG \n`
						msg+= `账户:${data_item['account']} 服务器: ${data_item['server']}\n` 
						msg+= `截至时间:${data_item['kkdate']} ${data_item['time']} \n`
						msg+= `服务器执行人: ${data_item['config_worker']}  \n`
						msg+= `配置文件位置: ${data_item['config_Path']}  \n`
						msg+= `服务器工单状态: ${data_item['config_status']}  \n`
						msg+= `期货操作:${data_item['future_operate']}  \n`
						msg+= `期货执行人: ${data_item['future_worker']}  \n`
						msg+= `期货工单状态: ${data_item['future_status']} `
					
						
						
						if (data_item['future_status']!='准备' & data_item['future_status']!='准备'   && scope.column['label']=='状态'){
							that.$axios.post(that.lpapi2, "form=send_msg&user=all&msg="+msg).then(response => {
								console.log(response, 'send_msg');
								if (response.status = 200) {
									let a=1
									// this.get_exchange_arrange()
								} else {
									console.log(response.data.statusCode);
								}
								
							})
						}
						
				}
				if (type=='binary'){
					 data_item = this.binary_data[scope.$index]
					 sql2 = "UPDATE `LP_tradesys_binary` SET \
						`using_binary` = '" + data_item['using_binary'] + "', `last_date` = '" + data_item['kkdate'] + "', \
						`updateplan` = '" + data_item['updateplan'] + "', `Path` = '" + data_item['Path'] + "',   \
						`updater` = '" + data_item['updater'] + "', `orthorizer` = '" + data_item['orthorizer'] + "',   \
						`time` = '" + data_item['time'] + "', `prod` = '" + data_item['prod'] + "', \
						`solarflare` = '" + data_item['solarflare'] + "',`status` = '" + data_item['status'] + "',  \
						`server` = '" + data_item['server'] + "' \
						WHERE `binary_index` = " + data_item['binary_index'] + ";"
					
				}
				

				that.$axios.post(that.lpapi2, "form=do_sql&sql=" + sql2).then(response => {
					console.log(response, 'do_sql');
					if (response.status = 200) {
						this.$message({
							message: '更新',
							type: 'success'
						});
						// if (type=='config'){
						// 	this.get_config_data()
						// }
						// if (type=='binary'){
						// 	this.get_binary_data()
						// }
						
					} else {
						return
						console.log(response.data.statusCode);
					}
				})
			},
			
			

			
			handlefixaccount(index, row) {
				console.log("row", row)
				this.fix_account = row
				this.visible2 = true
			},
			handleDelete(index, row,type) {

				// console.log("ID",this.kkdata[index]['factor_name'])
				console.log("row", row['configindex'])
			
				// this.exchange_arrange=row
				var that = this;

				this.$confirm('此操作将永久修改数据, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',inputType: 'password',
					type: 'warning'
				}).then(() => {
					let sql2 =""
					if (type=='config'){
						this.configindex = row['configindex']
						sql2 = "delete from `LP_tradesys_config`  WHERE `configindex`='" + this.configindex + "';"
					}
					if (type=='binary'){
						this.binaryindex = row['binary_index']
						sql2 = "delete from `LP_tradesys_binary`  WHERE `binary_index`='" + this.binaryindex + "';"
						
					}
					
									
					that.$axios.post(that.lpapi2, "form=do_sql&sql=" + sql2).then(response => {
						console.log(response, 'do_sql');
						if (response.status = 200) {
							this.$message({
								message: '删除完成',
								type: 'success'
							});
							if (type=='config'){
								this.get_config_data()
							}
							if (type=='binary'){
								this.get_binary_data()
							}
							
						} else {
							return
							console.log(response.data.statusCode);
						}
					})


				}).catch(() => {
					this.$message({
						type: 'info',
						message: '取消删除'
					});
				});
			},

			refleash_binary() {
				this.get_binary_data()
			},
			refleash_config() {
				this.get_config_data()
			},
			
			
			
			
			
			addnew_binary() {
				var that = this;
				var date = new Date();
				var seperator1 = "-";
				var year = date.getFullYear();
				var month = date.getMonth() + 1;
				var strDate = date.getDate();
				if (month >= 1 && month <= 9) {
					month = "0" + month;
				}
				if (strDate >= 0 && strDate <= 9) {
					strDate = "0" + strDate;
				}
				var currentdate = year + seperator1 + month + seperator1 + strDate;
				let sql2 = "INSERT INTO `LP_tradesys_binary`(`last_date`,`status`,`updatetime`) VALUES ('" +
					currentdate + "','准备',CURRENT_TIMESTAMP);"
				that.$axios.post(that.lpapi2, "form=do_sql&sql=" + sql2).then(response => {
					console.log(response, 'do_sql');
					if (response.status = 200) {
						this.$message({
							message: '新增完成',
							type: 'success'
						});
						this.get_binary_data()
					} else {
						return
						console.log(response.data.statusCode);
					}
				})
			
			},
			
			
			
			
			
			addnew_config() {
				var that = this;
				var date = new Date();
				var seperator1 = "-";
				var year = date.getFullYear();
				var month = date.getMonth() + 1;
				var strDate = date.getDate();
				if (month >= 1 && month <= 9) {
					month = "0" + month;
				}
				if (strDate >= 0 && strDate <= 9) {
					strDate = "0" + strDate;
				}
				var currentdate = year + seperator1 + month + seperator1 + strDate;
				let sql2 = "INSERT INTO `LP_tradesys_config`(`last_date`,`config_status`,`future_status`,`updatetime`) VALUES ('" +
					currentdate + "','准备','准备',CURRENT_TIMESTAMP);"
				that.$axios.post(that.lpapi2, "form=do_sql&sql=" + sql2).then(response => {
					console.log(response, 'do_sql');
					if (response.status = 200) {
						this.$message({
							message: '新增完成',
							type: 'success'
						});
						this.get_config_data()
					} else {
						return
						console.log(response.data.statusCode);
					}
				})

			},

			get_date_last() {
				var that = this;
				let sql =
					" select date_format(last_date,'%Y-%m-%d') as kkdate ,last_date from `LP_tradesys_config`  GROUP BY last_date;"
				that.$axios.post(that.lpapi2, "form=get_data&sql=" + sql).then(response => {
					console.log(response, 'data_tradesys_account');
					if (response.status = 200) {
						that.date_options = []
						//for (var i = 0; i < response.data.length; i++) {
						for (var i = response.data.length - 1; i >= 0; i--) {
							let char = {
								value: response.data[i]['kkdate'],
								label: response.data[i]['kkdate'],
							};
							that.date_options.push(char);
						}
					} else {
						console.log(response.data.statusCode);
					}
				})

			},



			get_tradesys_account() {
				var that = this;
				// console.log(that.lpapi2)

				let sql =
					"select * from `LP_account_list` ORDER BY account_type ;"
				that.$axios.post(that.lpapi2, "form=get_data&sql=" + sql).then(response => {

					console.log(response, 'conf_tradesys_account')
					let plat_list = []
					if (response.status = 200) {
						that.account_options = []
						that.kkdata = response.data;
						for (var i = 0; i < response.data.length; i++) {
							let char = {
								value: response.data[i]['account'],
								label: response.data[i]['account'],

							};

							that.account_options.push(char);
						}

					} else {
						console.log(response.data.statusCode);
					}
				})
			},
			
			get_binary_data(){
				var that = this;
				console.log(that.lpapi2)
				
				let sql =
					"select * ,date_format(last_date,'%Y-%m-%d') as kkdate,date_format(updatetime,'%Y-%m-%d  %H:%i:%s') as kkupdatetime \
					from `LP_tradesys_binary`  ORDER BY binary_index desc limit 20;"
				
				that.binary_data = []
				that.$axios.post(that.lpapi2, "form=get_data&sql=" + sql).then(response => {
				
					console.log(response.data[0], 'LP_tradesys_binary')
				
					if (response.status = 200) {
						if (response.data[0].hasOwnProperty('message')) {
							that.binary_data = []
						} else {
							that.binary_data = response.data;
						}
						// that.config_data = response.data;
					} else {
						console.log(response.data.statusCode);
					}
				})
				
			},
			
			
			
			
			
			get_config_data() {
				var that = this;
				console.log(that.lpapi2)

				let sql =
					"select * ,date_format(last_date,'%Y-%m-%d') as kkdate,date_format(updatetime,'%Y-%m-%d  %H:%i:%s') as kkupdatetime \
					from `LP_tradesys_config`  ORDER BY configindex desc limit 20;"
				if (this.account_choice != "" && this.date_choice != "") {
					sql =
						"select * ,date_format(last_date,'%Y-%m-%d') as kkdate,date_format(updatetime,'%Y-%m-%d  %H:%i:%s') as kkupdatetime \
					from `LP_tradesys_config` where account='" + this.account_choice + "' and  last_date='" + this.date_choice +
						"' ORDER BY configindex desc limit 20;"
				} else if (this.account_choice != "") {
					sql =
						"select * ,date_format(last_date,'%Y-%m-%d') as kkdate,date_format(updatetime,'%Y-%m-%d  %H:%i:%s') as kkupdatetime \
					from `LP_tradesys_config` where account='" + this.account_choice +
						"'  ORDER BY configindex desc limit 20;"
				} else if (this.date_choice != "") {
					sql =
						"select * ,date_format(last_date,'%Y-%m-%d') as kkdate,date_format(updatetime,'%Y-%m-%d  %H:%i:%s') as kkupdatetime \
					from `LP_tradesys_config` where last_date='" + this.date_choice + "'  ORDER BY configindex desc limit 20;"
				}
				that.config_data = []
				that.$axios.post(that.lpapi2, "form=get_data&sql=" + sql).then(response => {

					console.log(response.data[0], 'LP_tradesys_config')

					if (response.status = 200) {
						if (response.data[0].hasOwnProperty('message')) {
							that.config_data = []
						} else {
							that.config_data = response.data;
						}
						// that.config_data = response.data;
					} else {
						console.log(response.data.statusCode);
					}
				})


			},


			tableRowClassNamebinary({
				row,
				rowIndex
			}) {
				if (this.binary_data[rowIndex]['status'] == '待处理') {
					return 'warning-row2';
				}
				if (this.binary_data[rowIndex]['status'] == '异常') {
					return 'warning-row';
				}
				return '';
			},


			tableRowClassNameconfig({
				row,
				rowIndex
			}) {
				if (this.config_data[rowIndex]['config_status'] == '异常') {
					return 'warning-row';
				}
				if (this.config_data[rowIndex]['future_status'] == '异常') {
					return 'warning-row';
				}
				if (this.config_data[rowIndex]['config_status'] == '待处理') {
					return 'warning-row2';
				}
				if (this.config_data[rowIndex]['future_status'] == '待处理') {
					return 'warning-row2';
				}
				if (this.config_data[rowIndex]['config_status'] == '准备') {
					return 'warning-row2';
				}
				if (this.config_data[rowIndex]['future_status'] == '准备') {
					return 'warning-row2';
				}
				return '';
			}


		},
	}
</script>

<style>
	.el-table .warning-row {
		background: OrangeRed;
	}

	.el-table .warning-row2 {
		background: orange;
	}

	.el-table .success-row {
		background: grey;
		color: white;
	}

	.table_container {
		margin: 20px 5%;
		/* background-color: #0000FF; */
	}

	
	
</style>
